﻿@model DiplomaWeb.Models.CompaniesAndLecturers.CompanyListViewModel

<script type="text/javascript" language="javascript">
    function AddCompany() {
        var path = '@Url.RouteUrl("Default", new {controller = "SystemManagers", action = "AddCompany"})';
        var companyName = $("#companyAddTextField").val();
        $.ajax({
            url: path,
            type: "POST",
            async: false,
            data: ({ companyName: companyName }),
            success: function () {
                LoadCompaniesList();
            }
        });
    }
</script>

<div style="text-align: center;" class="largeText">
    <b>Список компаний:</b>
</div>
<hr />
<div>
    <div id="divCompanyList">
        @Html.DisplayForModel()
    </div>
    <div id="divCompanyAdd">
        <input id="companyAddTextField" type="text"/>
        <input id="companyAddButton" type="button" value="Добавить" onclick="AddCompany(); return false;"/>
    </div>
</div>